package com.niiwoo.civet.account.service.dubbo;

import com.alibaba.dubbo.config.annotation.Service;
import com.niiwoo.civet.account.dto.request.FundsFreezeOrderApplyRequestDTO;
import com.niiwoo.civet.account.dto.request.FundsUnfreezeOrderApplyRequestDTO;
import com.niiwoo.civet.account.dto.response.FundsFreezeOrderApplyResponseDTO;
import com.niiwoo.civet.account.dto.response.FundsFreezeOrderResponseDTO;
import com.niiwoo.civet.account.dto.response.FundsUnfreezeOrderApplyResponseDTO;
import com.niiwoo.civet.account.dto.response.FundsUnfreezeOrderResponseDTO;
import com.niiwoo.civet.account.enums.FundsOrderTypeEnum;
import com.niiwoo.civet.account.service.AccountFundsFreezeDubboService;
import com.niiwoo.civet.account.service.local.fundsFreeze.FundsFreezeLocalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author Jaylin
 * @Date 2018-04-23
 * @Descript 资金冻结dubbo实现类
 */
@Service(version = "1.0.0")
@Slf4j
public class AccountFundsFreezeDubboServiceImpl implements AccountFundsFreezeDubboService {

    @Autowired
    private FundsFreezeLocalService fundsFreezeLocalService;

    @Override
    public FundsFreezeOrderApplyResponseDTO applyFundsFreezeOrder(FundsFreezeOrderApplyRequestDTO fundsFreezeOrderApplyRequestDTO) {
        return fundsFreezeLocalService.applyFundsFreezeOrder(fundsFreezeOrderApplyRequestDTO);
    }

    @Override
    public FundsUnfreezeOrderApplyResponseDTO fundsUnfreezeOrder(FundsUnfreezeOrderApplyRequestDTO fundsUnfreezeOrderApplyRequestDTO) {
        return fundsFreezeLocalService.fundsUnfreezeOrder(fundsUnfreezeOrderApplyRequestDTO);
    }

    @Override
    public FundsFreezeOrderResponseDTO queryFundsFreezeOrderResult(Long orderId, FundsOrderTypeEnum fundsOrderTypeEnum) {
        return fundsFreezeLocalService.queryFundsFreezeOrderResult(orderId,fundsOrderTypeEnum);
    }

    @Override
    public FundsUnfreezeOrderResponseDTO queryFundsUnfreezeOrderResult(Long orderId, FundsOrderTypeEnum fundsOrderTypeEnum) {
        return fundsFreezeLocalService.queryFundsUnfreezeOrderResult(orderId,fundsOrderTypeEnum);
    }

    @Override
    public void jobProcessingFreezeOrder() {
        fundsFreezeLocalService.dealProcessingFreezeOrder();
    }

    @Override
    public void jobProcessingUnfreezeOrder() {
        fundsFreezeLocalService.dealProcessingUnfreezeOrder();
    }

}
